package com.kaibes.platform.article.listener;

import org.springframework.beans.factory.annotation.Autowired;

import com.kaibes.module.user.UserService;
import com.kaibes.orm.core.listener.DeleteListener;
import com.kaibes.orm.spring.OrmListener;
import com.kaibes.platform.article.db.service.ArticleCommentService;
import com.kaibes.platform.article.db.service.ArticleService;

@OrmListener(service = UserService.class)
public class ArticleUserDeleteListener implements DeleteListener {

    @Autowired
    private ArticleService articleService;
    @Autowired
    private ArticleCommentService articleCommentService;
    
    @Override
    public void afterClear(int count) throws Exception {
        articleService.clearCache();
        articleCommentService.clearCache();
    }
}
